<template>
  <div>
    <el-select v-bind="$attrs" :value="selectedValue" @change="onChangeValue" filterable placeholder="请选择">
      <el-option v-for="item in options" :key="item.value" :label="item.text" :value="item.value">
      </el-option>
    </el-select>
  </div>
</template>
<script>
export default {
  name: "category-cascader",
  inheritAttrs: false,
  model: {
     prop: "selectedValue",
     event: 'change'
  },
  props: {
    selectedValue: {
      default: ""
    },
    url: {
      default: "",
      type: String
    }
  },
  methods:{
      onChangeValue(v){
        this.$emit('change',v);
      }
  },
  data() {
    return {
      options: []
    };
  },
  created() {
    if (this.url) {
      this.combOptions(this.url).then(info => {
        this.options = info;
      });
    }
  }
};
</script>
